namespace Brjnk.Maps.Cache
{
    using System.Windows.Media.Imaging;

    public class GetCachedTileResult
    {
        public GetCachedTileResult(string mapName, TileId id, BitmapImage tile)
        {
            this.MapName = mapName;
            this.Id = id;
            this.Tile = tile;
        }

        public BitmapImage Tile { get; protected set; }

        public TileId Id { get; protected set; }

        public string MapName { get; protected set; }

        public bool IsTileEmpty { get { return object.ReferenceEquals(Tile, null); } }

        public static GetCachedTileResult Failed(string mapName, TileId id)
        {
            return new GetCachedTileResult(mapName, id, null);
        }
    }
}